﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Main.aspx.cs" Inherits="WebApplication1._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Главная</title>
    <style type="text/css">
        #form1
        {
            height: 453px;
            width: 985px;
        }
    </style>
</head>
<body bgcolor="orange">
    <form id="form1" runat="server" >
        
        
        
        
        <ItemTemplate>
        
                
        </ItemTemplate>
        
       
    

        
        <p>
            <asp:Label ID="Label3" runat="server" Text="Label" Visible="False" 
                ForeColor="Maroon" Font-Size="Large"></asp:Label>
            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Default.aspx">Выйти</asp:HyperLink>
            </p>
        <p>
            <asp:Label ID="Label4" runat="server" Font-Bold="True" Font-Size="Large" 
                ForeColor="Blue" Text="Договора нашей компании:"></asp:Label>
            </p>
        <p>
            <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
                AutoGenerateColumns="False" DataKeyNames="Id" DataSourceID="SqlDataSource1" 
                Font-Size="Large" ForeColor="#000099" BackColor="Yellow" 
                onselectedindexchanged="GridView1_SelectedIndexChanged">
                <Columns>
                    <asp:CommandField ShowSelectButton="True" />
                    <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" 
                        ReadOnly="True" SortExpression="Id" />
                    <asp:BoundField DataField="IdFlat" HeaderText="IdFlat" 
                        SortExpression="IdFlat" />
                    <asp:BoundField DataField="IdAgent" HeaderText="IdAgent" 
                        SortExpression="IdAgent" />
                    <asp:CheckBoxField DataField="Fire" HeaderText="Fire" SortExpression="Fire" />
                    <asp:CheckBoxField DataField="Water" HeaderText="Water" 
                        SortExpression="Water" />
                    <asp:CheckBoxField DataField="Wear" HeaderText="Wear" SortExpression="Wear" />
                    <asp:CheckBoxField DataField="Problem" HeaderText="Problem" 
                        SortExpression="Problem" />
                    <asp:CheckBoxField DataField="Loot" HeaderText="Loot" SortExpression="Loot" />
                    <asp:BoundField DataField="Date" HeaderText="Date" SortExpression="Date" />
                    <asp:BoundField DataField="Sum" HeaderText="Sum" SortExpression="Sum" />
                </Columns>
            </asp:GridView>
            &nbsp;<asp:Button ID="Button3" runat="server" onclick="Button3_Click" 
                Text="Добавить новый договор" Visible="False" />
            <asp:Button ID="Button4" runat="server" onclick="Button4_Click" 
                Text="База пользователей системы" Visible="False" />
            </p>
        <p>

        
<img src="20.gif" style="height: 88px; width: 101px" align="right"><asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:TestConnectionString %>" 
                SelectCommand="SELECT * FROM [Contract]" 
                DeleteCommand="DELETE FROM [Contract] WHERE [Id] = @Id" 
                InsertCommand="INSERT INTO [Contract] ([IdFlat], [IdAgent], [Fire], [Water], [Wear], [Problem], [Loot], [Date], [Sum]) VALUES (@IdFlat, @IdAgent, @Fire, @Water, @Wear, @Problem, @Loot, @Date, @Sum)" 
                UpdateCommand="UPDATE [Contract] SET [IdFlat] = @IdFlat, [IdAgent] = @IdAgent, [Fire] = @Fire, [Water] = @Water, [Wear] = @Wear, [Problem] = @Problem, [Loot] = @Loot, [Date] = @Date, [Sum] = @Sum WHERE [Id] = @Id">
                <DeleteParameters>
                    <asp:Parameter Name="Id" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="IdFlat" Type="Int32" />
                    <asp:Parameter Name="IdAgent" Type="Int32" />
                    <asp:Parameter Name="Fire" Type="Boolean" />
                    <asp:Parameter Name="Water" Type="Boolean" />
                    <asp:Parameter Name="Wear" Type="Boolean" />
                    <asp:Parameter Name="Problem" Type="Boolean" />
                    <asp:Parameter Name="Loot" Type="Boolean" />
                    <asp:Parameter DbType="Date" Name="Date" />
                    <asp:Parameter Name="Sum" Type="Int32" />
                    <asp:Parameter Name="Id" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="IdFlat" Type="Int32" />
                    <asp:Parameter Name="IdAgent" Type="Int32" />
                    <asp:Parameter Name="Fire" Type="Boolean" />
                    <asp:Parameter Name="Water" Type="Boolean" />
                    <asp:Parameter Name="Wear" Type="Boolean" />
                    <asp:Parameter Name="Problem" Type="Boolean" />
                    <asp:Parameter Name="Loot" Type="Boolean" />
                    <asp:Parameter DbType="Date" Name="Date" />
                    <asp:Parameter Name="Sum" Type="Int32" />
                </InsertParameters>
            </asp:SqlDataSource>
        </p>

        
&nbsp;</form>
</body>
</html>

